package com.yixin.hospital.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yixin.hospital.common.ApiResult;
import com.yixin.hospital.entity.bo.PageInfo;
import com.yixin.hospital.entity.domain.Drug;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yixin.hospital.entity.dto.req.drug.DrugAddReqDTO;
import com.yixin.hospital.entity.dto.req.drug.DrugEditReqDTO;
import com.yixin.hospital.entity.dto.req.drug.DrugPicEditReqDTO;
import com.yixin.hospital.entity.dto.req.visit.VisitSubPackageDrugReqDTO;
import com.yixin.hospital.entity.vo.DrugDepositoryAllDrugVo;
import com.yixin.hospital.entity.vo.DrugDepositoryDrugVo;
import com.yixin.hospital.entity.vo.DrugVo;
import com.yixin.hospital.entity.vo.PurchaseOrderVO;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
* @author Administrator
* @description 针对表【drug(药品表)】的数据库操作Service
* @createDate 2024-07-04 14:18:17
*/
public interface DrugService extends IService<Drug> {

    ApiResult<PageInfo<DrugVo>> allList(int currentPage, int pageSize, Long firstType, Long secondType, Long thirdType, String pinyinCode);

    ApiResult<String> getDrugCode(int firstType, int secondType, int thirdType);

    ApiResult<?> add(DrugAddReqDTO drugAddReqDTO, String userName);

    ApiResult<?> edit(DrugEditReqDTO drugEditReqDTO, String userName);

    ApiResult editDrugPic(DrugPicEditReqDTO drugPicEditReqDTO, String userName);

    ApiResult queryPicById(Long id);

    ApiResult<List<DrugVo>> queryByPinyinCode(String pinyinCode);

    ApiResult<List<DrugVo>> queryByCodeAndOptType(String pinyinCode, Integer optType, HttpServletRequest request);

    ApiResult<List<DrugVo>> queryByPinyinCodeAndDepository(String pinyinCode, List<Long> depositoryIds, Integer type);

    ApiResult<DrugDepositoryDrugVo> queryByCodeDepositoryId(String drugService, Long depositoryId);

    ApiResult<IPage<DrugDepositoryDrugVo>> depositoryNumList(int currentPage, int pageSize, String drugName, Long drugDepositoryId, Long userId);

    ApiResult<List<DrugDepositoryDrugVo>> depositoryNumDetail(String drugCode, Long drugDepositoryId);

    ApiResult<PurchaseOrderVO> queryDepositoryAllNum(HttpServletRequest request);

    ApiResult<DrugDepositoryAllDrugVo> queryDepositoryNum(String drugCode, HttpServletRequest request);

    ApiResult<?> takeDrug(VisitSubPackageDrugReqDTO visitSubPackageDrugReqDTO, String userName);
}
